<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/boost/algorithm/string/iter_find.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">usr/include/boost/algorithm/string</a> - iter_find.hpp<span style="font-size: 80%;"> (source / <a href="iter_find.hpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">6</td>
            <td class="headerCovTableEntry">6</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">1</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntryLo">50.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : //  Boost string_algo library iter_find.hpp header file  ---------------------------//</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : //  Copyright Pavol Droba 2002-2003.
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // Distributed under the Boost Software License, Version 1.0.
<span class="lineNum">       6 </span>            : //    (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       7 </span>            : //          http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">       8 </span>            : 
<span class="lineNum">       9 </span>            : //  See http://www.boost.org/ for updates, documentation, and revision history.
<span class="lineNum">      10 </span>            : 
<span class="lineNum">      11 </span>            : #ifndef BOOST_STRING_ITER_FIND_HPP
<span class="lineNum">      12 </span>            : #define BOOST_STRING_ITER_FIND_HPP
<span class="lineNum">      13 </span>            : 
<span class="lineNum">      14 </span>            : #include &lt;boost/algorithm/string/config.hpp&gt;
<span class="lineNum">      15 </span>            : #include &lt;algorithm&gt;
<span class="lineNum">      16 </span>            : #include &lt;iterator&gt;
<span class="lineNum">      17 </span>            : #include &lt;boost/iterator/transform_iterator.hpp&gt;
<span class="lineNum">      18 </span>            : 
<span class="lineNum">      19 </span>            : #include &lt;boost/range/iterator_range_core.hpp&gt;
<span class="lineNum">      20 </span>            : #include &lt;boost/range/begin.hpp&gt;
<span class="lineNum">      21 </span>            : #include &lt;boost/range/end.hpp&gt;
<span class="lineNum">      22 </span>            : #include &lt;boost/range/iterator.hpp&gt;
<span class="lineNum">      23 </span>            : #include &lt;boost/range/value_type.hpp&gt;
<span class="lineNum">      24 </span>            : #include &lt;boost/range/as_literal.hpp&gt;
<span class="lineNum">      25 </span>            : 
<span class="lineNum">      26 </span>            : #include &lt;boost/algorithm/string/concept.hpp&gt;
<span class="lineNum">      27 </span>            : #include &lt;boost/algorithm/string/find_iterator.hpp&gt;
<span class="lineNum">      28 </span>            : #include &lt;boost/algorithm/string/detail/util.hpp&gt;
<span class="lineNum">      29 </span>            : 
<span class="lineNum">      30 </span>            : /*! \file
<span class="lineNum">      31 </span>            :     Defines generic split algorithms. Split algorithms can be 
<span class="lineNum">      32 </span>            :     used to divide a sequence into several part according 
<span class="lineNum">      33 </span>            :     to a given criteria. Result is given as a 'container 
<span class="lineNum">      34 </span>            :     of containers' where elements are copies or references 
<span class="lineNum">      35 </span>            :     to extracted parts.
<span class="lineNum">      36 </span>            : 
<span class="lineNum">      37 </span>            :     There are two algorithms provided. One iterates over matching
<span class="lineNum">      38 </span>            :     substrings, the other one over the gaps between these matches.
<span class="lineNum">      39 </span>            : */
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span>            : namespace boost {
<span class="lineNum">      42 </span>            :     namespace algorithm {
<span class="lineNum">      43 </span>            : 
<span class="lineNum">      44 </span>            : //  iterate find ---------------------------------------------------//
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span>            :         //! Iter find algorithm
<span class="lineNum">      47 </span>            :         /*!
<span class="lineNum">      48 </span>            :             This algorithm executes a given finder in iteration on the input,
<span class="lineNum">      49 </span>            :             until the end of input is reached, or no match is found.
<span class="lineNum">      50 </span>            :             Iteration is done using built-in find_iterator, so the real 
<span class="lineNum">      51 </span>            :             searching is performed only when needed.
<span class="lineNum">      52 </span>            :             In each iteration new match is found and added to the result.
<span class="lineNum">      53 </span>            : 
<span class="lineNum">      54 </span>            :             \param Result A 'container container' to contain the result of search.
<span class="lineNum">      55 </span>            :                 Both outer and inner container must have constructor taking a pair
<span class="lineNum">      56 </span>            :                 of iterators as an argument.
<span class="lineNum">      57 </span>            :                 Typical type of the result is 
<span class="lineNum">      58 </span>            :                     \c std::vector&lt;boost::iterator_range&lt;iterator&gt;&gt;
<span class="lineNum">      59 </span>            :                 (each element of such a vector will container a range delimiting 
<span class="lineNum">      60 </span>            :                 a match).
<span class="lineNum">      61 </span>            :             \param Input A container which will be searched.
<span class="lineNum">      62 </span>            :             \param Finder A Finder object used for searching
<span class="lineNum">      63 </span>            :             \return A reference to the result
<span class="lineNum">      64 </span>            : 
<span class="lineNum">      65 </span>            :             \note Prior content of the result will be overwritten.
<span class="lineNum">      66 </span>            :         */
<span class="lineNum">      67 </span>            :         template&lt; 
<span class="lineNum">      68 </span>            :             typename SequenceSequenceT,
<span class="lineNum">      69 </span>            :             typename RangeT,
<span class="lineNum">      70 </span>            :             typename FinderT &gt;
<span class="lineNum">      71 </span>            :         inline SequenceSequenceT&amp;
<span class="lineNum">      72 </span>            :         iter_find(
<span class="lineNum">      73 </span>            :             SequenceSequenceT&amp; Result,
<span class="lineNum">      74 </span>            :             RangeT&amp; Input,
<span class="lineNum">      75 </span>            :             FinderT Finder )
<span class="lineNum">      76 </span>            :         {
<span class="lineNum">      77 </span>            :             BOOST_CONCEPT_ASSERT((
<span class="lineNum">      78 </span>            :                 FinderConcept&lt;
<span class="lineNum">      79 </span>            :                     FinderT,
<span class="lineNum">      80 </span>            :                     BOOST_STRING_TYPENAME range_iterator&lt;RangeT&gt;::type&gt;
<span class="lineNum">      81 </span>            :                 ));
<span class="lineNum">      82 </span>            : 
<span class="lineNum">      83 </span>            :             iterator_range&lt;BOOST_STRING_TYPENAME range_iterator&lt;RangeT&gt;::type&gt; lit_input(::boost::as_literal(Input));
<span class="lineNum">      84 </span>            : 
<span class="lineNum">      85 </span>            :             typedef BOOST_STRING_TYPENAME 
<span class="lineNum">      86 </span>            :                 range_iterator&lt;RangeT&gt;::type input_iterator_type;
<span class="lineNum">      87 </span>            :             typedef find_iterator&lt;input_iterator_type&gt; find_iterator_type;
<span class="lineNum">      88 </span>            :             typedef detail::copy_iterator_rangeF&lt;
<span class="lineNum">      89 </span>            :                 BOOST_STRING_TYPENAME 
<span class="lineNum">      90 </span>            :                     range_value&lt;SequenceSequenceT&gt;::type,
<span class="lineNum">      91 </span>            :                 input_iterator_type&gt; copy_range_type;
<span class="lineNum">      92 </span>            :             
<span class="lineNum">      93 </span>            :             input_iterator_type InputEnd=::boost::end(lit_input);
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span>            :             typedef transform_iterator&lt;copy_range_type, find_iterator_type&gt;
<span class="lineNum">      96 </span>            :                 transform_iter_type;
<span class="lineNum">      97 </span>            :     
<span class="lineNum">      98 </span>            :             transform_iter_type itBegin=
<span class="lineNum">      99 </span>            :                 ::boost::make_transform_iterator( 
<span class="lineNum">     100 </span>            :                     find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
<span class="lineNum">     101 </span>            :                     copy_range_type());
<span class="lineNum">     102 </span>            :             
<span class="lineNum">     103 </span>            :             transform_iter_type itEnd=
<span class="lineNum">     104 </span>            :                 ::boost::make_transform_iterator( 
<span class="lineNum">     105 </span>            :                     find_iterator_type(),
<span class="lineNum">     106 </span>            :                     copy_range_type());
<span class="lineNum">     107 </span>            : 
<span class="lineNum">     108 </span>            :             SequenceSequenceT Tmp(itBegin, itEnd);
<span class="lineNum">     109 </span>            :                         
<span class="lineNum">     110 </span>            :             Result.swap(Tmp);
<span class="lineNum">     111 </span>            :             return Result;
<span class="lineNum">     112 </span>            :         }
<span class="lineNum">     113 </span>            : 
<span class="lineNum">     114 </span>            : //  iterate split ---------------------------------------------------//
<span class="lineNum">     115 </span>            : 
<span class="lineNum">     116 </span>            :         //! Split find algorithm
<span class="lineNum">     117 </span>            :         /*!
<span class="lineNum">     118 </span>            :             This algorithm executes a given finder in iteration on the input,
<span class="lineNum">     119 </span>            :             until the end of input is reached, or no match is found.
<span class="lineNum">     120 </span>            :             Iteration is done using built-in find_iterator, so the real 
<span class="lineNum">     121 </span>            :             searching is performed only when needed.
<span class="lineNum">     122 </span>            :             Each match is used as a separator of segments. These segments are then
<span class="lineNum">     123 </span>            :             returned in the result.
<span class="lineNum">     124 </span>            : 
<span class="lineNum">     125 </span>            :             \param Result A 'container container' to contain the result of search.
<span class="lineNum">     126 </span>            :                 Both outer and inner container must have constructor taking a pair
<span class="lineNum">     127 </span>            :                 of iterators as an argument.
<span class="lineNum">     128 </span>            :                 Typical type of the result is 
<span class="lineNum">     129 </span>            :                     \c std::vector&lt;boost::iterator_range&lt;iterator&gt;&gt;
<span class="lineNum">     130 </span>            :                 (each element of such a vector will container a range delimiting 
<span class="lineNum">     131 </span>            :                 a match).
<span class="lineNum">     132 </span>            :             \param Input A container which will be searched.
<span class="lineNum">     133 </span>            :             \param Finder A finder object used for searching
<span class="lineNum">     134 </span>            :             \return A reference to the result
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span>            :             \note Prior content of the result will be overwritten.
<span class="lineNum">     137 </span>            :         */
<span class="lineNum">     138 </span>            :         template&lt; 
<span class="lineNum">     139 </span>            :             typename SequenceSequenceT,
<span class="lineNum">     140 </span>            :             typename RangeT,
<a name="141"><span class="lineNum">     141 </span>            :             typename FinderT &gt;</a>
<span class="lineNum">     142 </span>            :         inline SequenceSequenceT&amp;
<span class="lineNum">     143 </span><span class="lineCov">          1 :         iter_split(</span>
<span class="lineNum">     144 </span>            :             SequenceSequenceT&amp; Result,
<span class="lineNum">     145 </span>            :             RangeT&amp; Input,
<span class="lineNum">     146 </span>            :             FinderT Finder )
<span class="lineNum">     147 </span>            :         {
<span class="lineNum">     148 </span>            :             BOOST_CONCEPT_ASSERT((
<span class="lineNum">     149 </span>            :                 FinderConcept&lt;FinderT,
<span class="lineNum">     150 </span>            :                 BOOST_STRING_TYPENAME range_iterator&lt;RangeT&gt;::type&gt;
<span class="lineNum">     151 </span>            :                 ));
<span class="lineNum">     152 </span>            : 
<span class="lineNum">     153 </span>            :             iterator_range&lt;BOOST_STRING_TYPENAME range_iterator&lt;RangeT&gt;::type&gt; lit_input(::boost::as_literal(Input));
<span class="lineNum">     154 </span>            : 
<span class="lineNum">     155 </span>            :             typedef BOOST_STRING_TYPENAME 
<span class="lineNum">     156 </span>            :                 range_iterator&lt;RangeT&gt;::type input_iterator_type;
<span class="lineNum">     157 </span>            :             typedef split_iterator&lt;input_iterator_type&gt; find_iterator_type;
<span class="lineNum">     158 </span>            :             typedef detail::copy_iterator_rangeF&lt;
<span class="lineNum">     159 </span>            :                 BOOST_STRING_TYPENAME 
<span class="lineNum">     160 </span>            :                     range_value&lt;SequenceSequenceT&gt;::type,
<span class="lineNum">     161 </span>            :                 input_iterator_type&gt; copy_range_type;
<span class="lineNum">     162 </span>            :             
<span class="lineNum">     163 </span><span class="lineCov">          1 :             input_iterator_type InputEnd=::boost::end(lit_input);</span>
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span>            :             typedef transform_iterator&lt;copy_range_type, find_iterator_type&gt;
<span class="lineNum">     166 </span>            :                 transform_iter_type;
<span class="lineNum">     167 </span>            :     
<span class="lineNum">     168 </span>            :             transform_iter_type itBegin=
<span class="lineNum">     169 </span>            :                 ::boost::make_transform_iterator( 
<span class="lineNum">     170 </span>            :                     find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
<span class="lineNum">     171 </span><span class="lineCov">          3 :                     copy_range_type() );</span>
<span class="lineNum">     172 </span>            : 
<span class="lineNum">     173 </span>            :             transform_iter_type itEnd=
<span class="lineNum">     174 </span>            :                 ::boost::make_transform_iterator( 
<span class="lineNum">     175 </span>            :                     find_iterator_type(),
<span class="lineNum">     176 </span><span class="lineCov">          1 :                     copy_range_type() );</span>
<span class="lineNum">     177 </span>            :             
<span class="lineNum">     178 </span><span class="lineCov">          4 :             SequenceSequenceT Tmp(itBegin, itEnd);</span>
<span class="lineNum">     179 </span>            : 
<span class="lineNum">     180 </span>            :             Result.swap(Tmp);
<span class="lineNum">     181 </span><span class="lineCov">          1 :             return Result;</span>
<span class="lineNum">     182 </span>            :         }
<span class="lineNum">     183 </span>            : 
<span class="lineNum">     184 </span>            :     } // namespace algorithm
<span class="lineNum">     185 </span>            : 
<span class="lineNum">     186 </span>            :     // pull names to the boost namespace
<span class="lineNum">     187 </span>            :     using algorithm::iter_find;
<span class="lineNum">     188 </span>            :     using algorithm::iter_split;
<span class="lineNum">     189 </span>            : 
<span class="lineNum">     190 </span>            : } // namespace boost
<span class="lineNum">     191 </span>            : 
<span class="lineNum">     192 </span>            : 
<span class="lineNum">     193 </span>            : #endif  // BOOST_STRING_ITER_FIND_HPP
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
